package com.ctshk.rpc.order.custom.dto.tourist;


import com.ctshk.common.enums.NumberConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Objects;

@Data
@ApiModel(value="游客信息DTO", description="游客信息DTO")
public class CustomOrderTouristInfoDTO implements Serializable {
    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "所属订单")
    private Long orderId;

    @ApiModelProperty(value = "团期ID")
    private Long scheduleId;

    @ApiModelProperty(value = "所属组ID")
    private Long groupId;

    @ApiModelProperty(value = "所属房间ID")
    private Long roomId;

    @ApiModelProperty(value = "所属套餐")
    private Long packageId;

    @ApiModelProperty(value = "套餐名称")
    private String packageName;

    @ApiModelProperty(value = "游客类型主数据ID")
    private Long mainDataId;

    @ApiModelProperty(value = "游客类型名称")
    private String touristTypeName;

    @ApiModelProperty(value = "中文姓")
    private String cnSurname;

    @ApiModelProperty(value = "中文姓名")
    private String cnName;

    @ApiModelProperty(value = "英文姓")
    private String enSurname;

    @ApiModelProperty(value = "英文名称")
    private String enName;

    @ApiModelProperty(value = "性别")
    private Integer gender;

    @ApiModelProperty(value = "国籍")
    private String nation;

    @ApiModelProperty(value = "电话区号")
    private String mobileAreaCode;

    @ApiModelProperty(value = "联系方式")
    private String mobile;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "证件类型")
    private String certificateType;

    @ApiModelProperty(value = "证件号")
    private String certificateNumber;

    @ApiModelProperty(value = "证件有效期")
    private LocalDate certificateValidDate;

    @ApiModelProperty(value = "证件签发地")
    private String certificatePlace;

    @ApiModelProperty(value = "紧急联系人姓名")
    private String emergencyContactName;

    @ApiModelProperty(value = "紧急联系人电话区号")
    private String emergencyMobileAreaCode;

    @ApiModelProperty(value = "紧急联系人电话")
    private String emergencyMobile;

    @ApiModelProperty(value = "付款状态（1 待付款 2 待付余款 3 已付全款 4 已退团）")
    private Integer payStatus;

    @ApiModelProperty(value = "退团状态")
    private Integer quitRefundStatus;

    @ApiModelProperty(value = "是否完善资料(0 否,1 是)")
    private Integer isFullInfo;

    @ApiModelProperty(value = "NoShow")
    private Integer noshow;

    @ApiModelProperty(value = "渠道来源主数据ID")
    private Long channelId;

    @ApiModelProperty(value = "锁定状态")
    private Integer lockStatus;

    @ApiModelProperty(value = "创建人")
    private Long createId;

    @ApiModelProperty(value = "修改人")
    private Long modifiedId;

    @ApiModelProperty(value = "删除标识")
    private Integer isDeleted;

    @ApiModelProperty(value = "出生日期")
    private LocalDate birthday;

    @ApiModelProperty(value = "应收")
    private BigDecimal totalReceivables;

    @ApiModelProperty(value = "实收")
    private BigDecimal totalPaidIn;

    @ApiModelProperty(value = "未收")
    private BigDecimal remainingReceivables;

    //狀態：取【收款管理】的狀態，退團狀態優先收款狀態
    public Integer getPayStatus() {
        if (Objects.equals(this.quitRefundStatus, NumberConstant.FOUR.getValue())) {
            this.payStatus = NumberConstant.FOUR.getValue();
        }
        return payStatus;
    }
}
